/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * LoanComputerManual.java
 *
 * Created on 20/06/2011, 09:29:26 AM
 */

package GUI.ATTENDANT;

import GUI.Customer.Server;
import Procedures.DBConection;
import Procedures.LoanTable;
import javax.swing.JFrame;

/**
 *
 * @author SIX-14
 */
public class LoanComputerManual extends javax.swing.JPanel {

    /** Creates new form LoanComputerManual */
    public LoanComputerManual() {
        initComponents();
    }
    public LoanComputerManual(DBConection myConection, JFrame paternFrame, LoanTable loanTable, Server server){
        initComponents();
        this.myConection=myConection;
        this.paternFrame=paternFrame;
        this.loanTable=loanTable;
        this.server=server;

    }

    private DBConection myConection;
    private JFrame paternFrame;
    private LoanTable loanTable;
    private Server server;

    public Server getServer() {
        return server;
    }

    public void setServer(Server server) {
        this.server = server;
    }



    public LoanTable getLoanTable() {
        return loanTable;
    }

    public void setLoanTable(LoanTable loanTable) {
        this.loanTable = loanTable;
    }

    public DBConection getMyConection() {
        return myConection;
    }

    public void setMyConection(DBConection myConection) {
        this.myConection = myConection;
    }

    public JFrame getPaternFrame() {
        return paternFrame;
    }

    public void setPaternFrame(JFrame paternFrame) {
        this.paternFrame = paternFrame;
    }




    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();

        jLabel1.setText("jLabel1");

        jButton1.setText("Comenzar prestamo");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Terminar prestamo");
        jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton2MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jButton1))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jButton2)))
                .addContainerGap(261, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton1)
                .addGap(33, 33, 33)
                .addComponent(jButton2)
                .addContainerGap(185, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        getPaternFrame().getContentPane().removeAll();
        getPaternFrame().add(new AssignComputerManual(getMyConection(),getPaternFrame(),getLoanTable(),getServer()));
        getPaternFrame().pack();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
        getPaternFrame().getContentPane().removeAll();
        getPaternFrame().add(new FinisherLoanComputerManual(getMyConection(),getPaternFrame(),getLoanTable(), getServer()));
        getPaternFrame().pack();
    }//GEN-LAST:event_jButton2MouseClicked


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables

}
